{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Imports\n",
    "\n",
    "Import all the modules and functionalities we need."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "# Import standard libraries.\n",
    "import os\n",
    "\n",
    "# Import third party libraries.\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "from statsmodels.stats.multitest import multipletests\n",
    "from statsmodels.stats.proportion import proportions_ztest\n",
    "\n",
    "# Import custom libraries/scripts.\n",
    "import annotations\n",
    "import helpers"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Loading data\n",
    "\n",
    "Fetch all our relevant data for the current analysis."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set working contants.\n",
    "EXPERIMENTS_PATH = r'\\\\10.40.12.80\\home\\PhD\\Results\\Competition\\DL\\small_arenas\\Or47b\\crossed_with_white_minus\\processed'\n",
    "FPS = 60\n",
    "N_MINUTES = 5\n",
    "N_FRAMES = N_MINUTES * 60 * FPS # First five minutes of copulation.\n",
    "INK = 'black'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set figure configurations.\n",
    "sns.set(\n",
    "        context='paper',\n",
    "        style='ticks',\n",
    "        font='sans-serif',\n",
    "        font_scale=1.0, \n",
    "        rc={\n",
    "            'axes.axisbelow': True,\n",
    "            'axes.edgecolor': INK,\n",
    "            'axes.facecolor': 'white' if INK=='black' else 'black',\n",
    "            'axes.grid': False,\n",
    "            'axes.labelcolor': INK,\n",
    "            'axes.labelsize': 13.0,\n",
    "            'axes.labelweight': 'normal',\n",
    "            'axes.linewidth': 1.0,\n",
    "            'axes.spines.left': True,\n",
    "            'axes.spines.bottom': True,\n",
    "            'axes.spines.top': False,\n",
    "            'axes.spines.right': False,\n",
    "            'axes.titlepad': 15.0,\n",
    "            'axes.titlesize': 20.0,\n",
    "            'axes.titleweight': 'bold',\n",
    "            'figure.facecolor': 'white' if INK=='black' else 'black',\n",
    "            'figure.figsize': [4.0, 4.0],\n",
    "            'figure.titlesize': 30.0,\n",
    "            'figure.titleweight': 'bold',\n",
    "            'font.family': ['sans-serif'],\n",
    "            'font.sans-serif': ['Arial'],\n",
    "            'legend.frameon': False,\n",
    "            'legend.fontsize': 11.0,\n",
    "            'lines.color': INK,\n",
    "            'lines.linewidth': 1.0,\n",
    "            'patch.edgecolor': INK,\n",
    "            'savefig.dpi': 300,\n",
    "            'savefig.format': 'png',\n",
    "            'savefig.bbox': 'tight',\n",
    "            'savefig.transparent': True,\n",
    "            'text.color': INK,\n",
    "            'text.usetex': False,\n",
    "            'xtick.color': INK,\n",
    "            'xtick.direction': 'out',\n",
    "            'xtick.labelsize': 12.0,\n",
    "            'xtick.major.pad': 5.0,\n",
    "            'xtick.major.size': 0.0,\n",
    "            'xtick.major.width': 1.0,\n",
    "            'xtick.minor.size': 0.0,\n",
    "            'xtick.minor.width': 0.4,\n",
    "            'ytick.color': INK,\n",
    "            'ytick.direction': 'out',\n",
    "            'ytick.labelsize': 12.0,\n",
    "            'ytick.major.pad': 5.0,\n",
    "            'ytick.major.size': 3.0,\n",
    "            'ytick.major.width': 1.0,\n",
    "            'ytick.minor.size': 0.0,\n",
    "            'ytick.minor.width': 0.4\n",
    "           }\n",
    "       )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Folder already exists, skipping.\n"
     ]
    }
   ],
   "source": [
    "# Prepare the Figures folder to save our graphs in.\n",
    "savepath = os.path.join(r'C:\\Users\\Miguel\\Desktop\\paper_data', 'paper_figures', 'figure4')\n",
    "try:\n",
    "    os.makedirs(savepath)\n",
    "    print(\"New folder created.\")\n",
    "except FileExistsError:\n",
    "    print(\"Folder already exists, skipping.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Paths to conditions:\n",
      " ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control', '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test', '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control']\n"
     ]
    }
   ],
   "source": [
    "# Set the conditions to analyze.\n",
    "condition_order = ['gal4_control', 'uas_control', 'test']\n",
    "conditions = [item.path for item in os.scandir(EXPERIMENTS_PATH) if item.name in condition_order]\n",
    "print('Paths to conditions:\\n', conditions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t\n",
      " gal4_control\n",
      "\t\n",
      " test\n",
      "Copulation too short: video_2021-02-16T10_30_25_arena11.csv\n",
      "\t\n",
      " uas_control\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'gal4_control': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T11_52_18_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T11_52_18_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T11_52_18_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T11_52_18_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T12_31_46_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T12_31_46_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T12_31_46_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T10_30_25_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T10_30_25_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T10_30_25_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T10_30_25_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena13.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena13.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena5.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-19T12_26_51_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-19T12_26_51_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-19T12_26_51_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-19T12_26_51_arena8.csv'],\n",
       " 'uas_control': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-15T11_52_18_arena14.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-15T11_52_18_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-15T12_31_46_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-15T12_31_46_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T10_30_25_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T10_30_25_arena13.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T10_30_25_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T10_30_25_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T11_24_30_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T11_24_30_arena14.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T11_24_30_arena5.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T11_24_30_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T11_53_24_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T11_53_24_arena13.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T11_53_24_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T12_30_11_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T12_30_11_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T12_30_11_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-18T10_30_35_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-18T10_30_35_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-19T12_26_51_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-19T12_26_51_arena5.csv'],\n",
       " 'test': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T11_52_18_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T11_52_18_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T11_52_18_arena5.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T11_52_18_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T12_31_46_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T12_31_46_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T12_31_46_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T12_31_46_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T10_30_25_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T10_30_25_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T10_30_25_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T11_24_30_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T11_24_30_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T11_24_30_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena14.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena5.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T12_30_11_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T12_30_11_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T12_30_11_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T12_30_11_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena9.csv']}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Load all usable experiments for each condition.\n",
    "experiments = {condition: [] for condition in condition_order}\n",
    "\n",
    "for condition_path in conditions:\n",
    "    \n",
    "    condition = os.path.basename(condition_path)\n",
    "    print('\\t\\n', condition)\n",
    "    \n",
    "    for item in os.scandir(condition_path):\n",
    "        if item.name.endswith('.csv'):\n",
    "            \n",
    "            annotation_video = annotations.read(item.path)\n",
    "\n",
    "            try:\n",
    "                copulation = annotation_video[0].events[0]\n",
    "                copulation_duration = copulation.duration\n",
    "\n",
    "                # Filter out videos where copulation is interrupted.\n",
    "                copulation_end = copulation.time_interval[1]\n",
    "                if copulation_end==N_FRAMES:\n",
    "                    if copulatio.duration < 5 * 60 * FPS:\n",
    "                        print('Copulation interrupted:', item.name)\n",
    "                        continue\n",
    "\n",
    "                # Filter out videos where copulation lasts less than 8 minutes.\n",
    "                if copulation_duration <= 8 * 60 * FPS:\n",
    "                    print('Copulation too short:', item.name)\n",
    "                    continue\n",
    "            \n",
    "            except IndexError:\n",
    "                continue\n",
    "            \n",
    "            experiments[condition].append(item.path)\n",
    "\n",
    "experiments"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Aggression Analysis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iteration: 0 \n",
      "Experiment: video_2021-02-15T11_52_18_arena3.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 1 \n",
      "Experiment: video_2021-02-15T11_52_18_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 2 \n",
      "Experiment: video_2021-02-15T11_52_18_arena6.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 3 \n",
      "Experiment: video_2021-02-15T11_52_18_arena8.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 4 \n",
      "Experiment: video_2021-02-15T12_31_46_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 5 \n",
      "Experiment: video_2021-02-15T12_31_46_arena7.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 6 \n",
      "Experiment: video_2021-02-15T12_31_46_arena9.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 7 \n",
      "Experiment: video_2021-02-16T10_30_25_arena1.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 8 \n",
      "Experiment: video_2021-02-16T10_30_25_arena10.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 9 \n",
      "Experiment: video_2021-02-16T10_30_25_arena16.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 10 \n",
      "Experiment: video_2021-02-16T10_30_25_arena7.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 11 \n",
      "Experiment: video_2021-02-16T11_24_30_arena1.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 12 \n",
      "Experiment: video_2021-02-16T11_24_30_arena16.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 13 \n",
      "Experiment: video_2021-02-16T11_24_30_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 14 \n",
      "Experiment: video_2021-02-16T11_24_30_arena7.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 15 \n",
      "Experiment: video_2021-02-16T11_24_30_arena9.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 16 \n",
      "Experiment: video_2021-02-17T11_53_24_arena1.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 17 \n",
      "Experiment: video_2021-02-17T11_53_24_arena12.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 18 \n",
      "Experiment: video_2021-02-17T11_53_24_arena15.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 19 \n",
      "Experiment: video_2021-02-17T11_53_24_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 20 \n",
      "Experiment: video_2021-02-17T11_53_24_arena6.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 21 \n",
      "Experiment: video_2021-02-17T12_30_11_arena12.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 22 \n",
      "Experiment: video_2021-02-17T12_30_11_arena13.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 23 \n",
      "Experiment: video_2021-02-17T12_30_11_arena6.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 24 \n",
      "Experiment: video_2021-02-17T12_30_11_arena7.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 25 \n",
      "Experiment: video_2021-02-17T12_30_11_arena8.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 26 \n",
      "Experiment: video_2021-02-18T10_30_35_arena10.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 27 \n",
      "Experiment: video_2021-02-18T10_30_35_arena13.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 28 \n",
      "Experiment: video_2021-02-18T10_30_35_arena16.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 29 \n",
      "Experiment: video_2021-02-18T10_30_35_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 30 \n",
      "Experiment: video_2021-02-18T10_30_35_arena5.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 31 \n",
      "Experiment: video_2021-02-18T10_30_35_arena8.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 32 \n",
      "Experiment: video_2021-02-19T12_26_51_arena11.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 33 \n",
      "Experiment: video_2021-02-19T12_26_51_arena15.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 34 \n",
      "Experiment: video_2021-02-19T12_26_51_arena6.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 35 \n",
      "Experiment: video_2021-02-19T12_26_51_arena8.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 0 \n",
      "Experiment: video_2021-02-15T11_52_18_arena14.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 1 \n",
      "Experiment: video_2021-02-15T11_52_18_arena9.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 2 \n",
      "Experiment: video_2021-02-15T12_31_46_arena11.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 3 \n",
      "Experiment: video_2021-02-15T12_31_46_arena3.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 4 \n",
      "Experiment: video_2021-02-16T10_30_25_arena12.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 5 \n",
      "Experiment: video_2021-02-16T10_30_25_arena13.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 6 \n",
      "Experiment: video_2021-02-16T10_30_25_arena3.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 7 \n",
      "Experiment: video_2021-02-16T10_30_25_arena8.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 8 \n",
      "Experiment: video_2021-02-16T11_24_30_arena11.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 9 \n",
      "Experiment: video_2021-02-16T11_24_30_arena14.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 10 \n",
      "Experiment: video_2021-02-16T11_24_30_arena5.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 11 \n",
      "Experiment: video_2021-02-16T11_24_30_arena8.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 12 \n",
      "Experiment: video_2021-02-17T11_53_24_arena10.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 13 \n",
      "Experiment: video_2021-02-17T11_53_24_arena13.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 14 \n",
      "Experiment: video_2021-02-17T11_53_24_arena8.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 15 \n",
      "Experiment: video_2021-02-17T12_30_11_arena1.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 16 \n",
      "Experiment: video_2021-02-17T12_30_11_arena15.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 17 \n",
      "Experiment: video_2021-02-17T12_30_11_arena16.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 18 \n",
      "Experiment: video_2021-02-18T10_30_35_arena7.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 19 \n",
      "Experiment: video_2021-02-18T10_30_35_arena9.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 20 \n",
      "Experiment: video_2021-02-19T12_26_51_arena2.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 21 \n",
      "Experiment: video_2021-02-19T12_26_51_arena5.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 0 \n",
      "Experiment: video_2021-02-15T11_52_18_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 1 \n",
      "Experiment: video_2021-02-15T11_52_18_arena15.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 2 \n",
      "Experiment: video_2021-02-15T11_52_18_arena5.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 3 \n",
      "Experiment: video_2021-02-15T11_52_18_arena7.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 4 \n",
      "Experiment: video_2021-02-15T12_31_46_arena10.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 5 \n",
      "Experiment: video_2021-02-15T12_31_46_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 6 \n",
      "Experiment: video_2021-02-15T12_31_46_arena2.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 7 \n",
      "Experiment: video_2021-02-15T12_31_46_arena8.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 8 \n",
      "Experiment: video_2021-02-16T10_30_25_arena15.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 9 \n",
      "Experiment: video_2021-02-16T10_30_25_arena2.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 10 \n",
      "Experiment: video_2021-02-16T10_30_25_arena9.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 11 \n",
      "Experiment: video_2021-02-16T11_24_30_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 12 \n",
      "Experiment: video_2021-02-16T11_24_30_arena15.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 13 \n",
      "Experiment: video_2021-02-16T11_24_30_arena6.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 14 \n",
      "Experiment: video_2021-02-17T11_53_24_arena14.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 15 \n",
      "Experiment: video_2021-02-17T11_53_24_arena3.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 16 \n",
      "Experiment: video_2021-02-17T11_53_24_arena5.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 17 \n",
      "Experiment: video_2021-02-17T11_53_24_arena7.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 18 \n",
      "Experiment: video_2021-02-17T11_53_24_arena9.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 19 \n",
      "Experiment: video_2021-02-17T12_30_11_arena11.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 20 \n",
      "Experiment: video_2021-02-17T12_30_11_arena2.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 21 \n",
      "Experiment: video_2021-02-17T12_30_11_arena3.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 22 \n",
      "Experiment: video_2021-02-17T12_30_11_arena9.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 23 \n",
      "Experiment: video_2021-02-18T10_30_35_arena11.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 24 \n",
      "Experiment: video_2021-02-18T10_30_35_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 25 \n",
      "Experiment: video_2021-02-18T10_30_35_arena15.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 26 \n",
      "Experiment: video_2021-02-18T10_30_35_arena2.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 27 \n",
      "Experiment: video_2021-02-18T10_30_35_arena6.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 28 \n",
      "Experiment: video_2021-02-19T12_26_51_arena1.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 29 \n",
      "Experiment: video_2021-02-19T12_26_51_arena10.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 30 \n",
      "Experiment: video_2021-02-19T12_26_51_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 31 \n",
      "Experiment: video_2021-02-19T12_26_51_arena16.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 32 \n",
      "Experiment: video_2021-02-19T12_26_51_arena3.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 33 \n",
      "Experiment: video_2021-02-19T12_26_51_arena7.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 34 \n",
      "Experiment: video_2021-02-19T12_26_51_arena9.csv \n",
      "Condition: test \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>has_aggression</th>\n",
       "      <th>aggression_latency</th>\n",
       "      <th>aggression_latency_mins</th>\n",
       "      <th>nframes</th>\n",
       "      <th>nbouts</th>\n",
       "      <th>ratio_frames</th>\n",
       "      <th>ratio_bouts</th>\n",
       "      <th>condition</th>\n",
       "      <th>experiment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>True</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>0.557500</td>\n",
       "      <td>609</td>\n",
       "      <td>6</td>\n",
       "      <td>0.033833</td>\n",
       "      <td>1.2</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena3.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "      <td>902.0</td>\n",
       "      <td>0.250556</td>\n",
       "      <td>443</td>\n",
       "      <td>7</td>\n",
       "      <td>0.024611</td>\n",
       "      <td>1.4</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena4.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>True</td>\n",
       "      <td>3789.0</td>\n",
       "      <td>1.052500</td>\n",
       "      <td>311</td>\n",
       "      <td>9</td>\n",
       "      <td>0.017278</td>\n",
       "      <td>1.8</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena6.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>True</td>\n",
       "      <td>2491.0</td>\n",
       "      <td>0.691944</td>\n",
       "      <td>438</td>\n",
       "      <td>12</td>\n",
       "      <td>0.024333</td>\n",
       "      <td>2.4</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena8.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>True</td>\n",
       "      <td>4246.0</td>\n",
       "      <td>1.179444</td>\n",
       "      <td>110</td>\n",
       "      <td>10</td>\n",
       "      <td>0.006111</td>\n",
       "      <td>2.0</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T12_31_46_arena4.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>True</td>\n",
       "      <td>2608.0</td>\n",
       "      <td>0.724444</td>\n",
       "      <td>219</td>\n",
       "      <td>4</td>\n",
       "      <td>0.012167</td>\n",
       "      <td>0.8</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena12.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>True</td>\n",
       "      <td>4727.0</td>\n",
       "      <td>1.313056</td>\n",
       "      <td>102</td>\n",
       "      <td>7</td>\n",
       "      <td>0.005667</td>\n",
       "      <td>1.4</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena16.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>True</td>\n",
       "      <td>3404.0</td>\n",
       "      <td>0.945556</td>\n",
       "      <td>59</td>\n",
       "      <td>6</td>\n",
       "      <td>0.003278</td>\n",
       "      <td>1.2</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena3.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>True</td>\n",
       "      <td>2285.0</td>\n",
       "      <td>0.634722</td>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>0.000889</td>\n",
       "      <td>1.0</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena7.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>True</td>\n",
       "      <td>2208.0</td>\n",
       "      <td>0.613333</td>\n",
       "      <td>163</td>\n",
       "      <td>4</td>\n",
       "      <td>0.009056</td>\n",
       "      <td>0.8</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena9.csv</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>93 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    has_aggression  aggression_latency  aggression_latency_mins  nframes  \\\n",
       "0             True              2007.0                 0.557500      609   \n",
       "1             True               902.0                 0.250556      443   \n",
       "2             True              3789.0                 1.052500      311   \n",
       "3             True              2491.0                 0.691944      438   \n",
       "4             True              4246.0                 1.179444      110   \n",
       "..             ...                 ...                      ...      ...   \n",
       "88            True              2608.0                 0.724444      219   \n",
       "89            True              4727.0                 1.313056      102   \n",
       "90            True              3404.0                 0.945556       59   \n",
       "91            True              2285.0                 0.634722       16   \n",
       "92            True              2208.0                 0.613333      163   \n",
       "\n",
       "    nbouts  ratio_frames  ratio_bouts     condition  \\\n",
       "0        6      0.033833          1.2  gal4_control   \n",
       "1        7      0.024611          1.4  gal4_control   \n",
       "2        9      0.017278          1.8  gal4_control   \n",
       "3       12      0.024333          2.4  gal4_control   \n",
       "4       10      0.006111          2.0  gal4_control   \n",
       "..     ...           ...          ...           ...   \n",
       "88       4      0.012167          0.8          test   \n",
       "89       7      0.005667          1.4          test   \n",
       "90       6      0.003278          1.2          test   \n",
       "91       5      0.000889          1.0          test   \n",
       "92       4      0.009056          0.8          test   \n",
       "\n",
       "                               experiment  \n",
       "0    video_2021-02-15T11_52_18_arena3.csv  \n",
       "1    video_2021-02-15T11_52_18_arena4.csv  \n",
       "2    video_2021-02-15T11_52_18_arena6.csv  \n",
       "3    video_2021-02-15T11_52_18_arena8.csv  \n",
       "4    video_2021-02-15T12_31_46_arena4.csv  \n",
       "..                                    ...  \n",
       "88  video_2021-02-19T12_26_51_arena12.csv  \n",
       "89  video_2021-02-19T12_26_51_arena16.csv  \n",
       "90   video_2021-02-19T12_26_51_arena3.csv  \n",
       "91   video_2021-02-19T12_26_51_arena7.csv  \n",
       "92   video_2021-02-19T12_26_51_arena9.csv  \n",
       "\n",
       "[93 rows x 9 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "aggression_df = pd.DataFrame()\n",
    "for condition in condition_order:\n",
    "    for h, experiment_path in enumerate(experiments[condition]):\n",
    "\n",
    "        experiment = os.path.basename(experiment_path)\n",
    "        \n",
    "        print('Iteration:', h, '\\nExperiment:', experiment, '\\nCondition:', condition, '\\n')\n",
    "        \n",
    "        # Exclude experiments without copulation (since aggression is only observed during copulation).\n",
    "        annotation_video = annotations.read(experiment_path)\n",
    "        try:\n",
    "            copulation = annotation_video[0].events[0]\n",
    "        except IndexError:\n",
    "            continue\n",
    "        \n",
    "        aggression_events = list(filter(lambda event: event.time < (copulation.time + N_FRAMES), annotation_video[1].events)) # Consider aggression only during the first 5 minutes of copulation.\n",
    "        n_events = len(aggression_events)\n",
    "\n",
    "        # In case there is aggression, do the necessary calculations.\n",
    "        if n_events > 0:\n",
    "            aggression_latency =  aggression_events[0].time - copulation.time\n",
    "            aggression_latency_mins = aggression_latency / (60 * FPS)\n",
    "            ratio_frames = sum([aggression.duration for aggression in aggression_events]) / N_FRAMES\n",
    "            ratio_bouts = n_events / N_MINUTES\n",
    "\n",
    "            aggression_data = pd.DataFrame({'has_aggression': True,\n",
    "                                            'aggression_latency': aggression_latency,\n",
    "                                            'aggression_latency_mins': aggression_latency_mins,\n",
    "                                            'nframes': sum([aggression.duration for aggression in aggression_events]),\n",
    "                                            'nbouts': n_events,\n",
    "                                            'ratio_frames': ratio_frames,\n",
    "                                            'ratio_bouts': ratio_bouts,\n",
    "                                            'condition': condition,\n",
    "                                            'experiment': experiment},\n",
    "                                            index=[h],\n",
    "                                           )\n",
    "\n",
    "        # If not, preset our dictionary with default values.\n",
    "        else:\n",
    "            aggression_data = pd.DataFrame({'has_aggression': False,\n",
    "                                            'aggression_latency': np.nan,\n",
    "                                            'aggression_latency_mins': 0,\n",
    "                                            'nframes': 0,\n",
    "                                            'nbouts': 0,\n",
    "                                            'ratio_frames': 0, \n",
    "                                            'ratio_bouts': 0,\n",
    "                                            'condition': condition,\n",
    "                                            'experiment': experiment},\n",
    "                                            index=[h],\n",
    "                                           )\n",
    "        \n",
    "        # Concatenate all data together.\n",
    "        aggression_df = pd.concat([aggression_df, aggression_data], ignore_index=True)\n",
    "\n",
    "aggression_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Outlier Detection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\t gal4_control \n",
      "\n",
      "[5, 33]\n",
      "Number data points considered outliers: 2\n",
      "Percent data points considered outliers: 5.556 %\n",
      "\n",
      "\t uas_control \n",
      "\n",
      "[56]\n",
      "Number data points considered outliers: 1\n",
      "Percent data points considered outliers: 4.545 %\n",
      "\n",
      "\t test \n",
      "\n",
      "[65]\n",
      "Number data points considered outliers: 1\n",
      "Percent data points considered outliers: 2.857 %\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>has_aggression</th>\n",
       "      <th>aggression_latency</th>\n",
       "      <th>aggression_latency_mins</th>\n",
       "      <th>nframes</th>\n",
       "      <th>nbouts</th>\n",
       "      <th>ratio_frames</th>\n",
       "      <th>ratio_bouts</th>\n",
       "      <th>condition</th>\n",
       "      <th>experiment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>True</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>0.557500</td>\n",
       "      <td>609</td>\n",
       "      <td>6</td>\n",
       "      <td>0.033833</td>\n",
       "      <td>1.2</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena3.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "      <td>902.0</td>\n",
       "      <td>0.250556</td>\n",
       "      <td>443</td>\n",
       "      <td>7</td>\n",
       "      <td>0.024611</td>\n",
       "      <td>1.4</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena4.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>True</td>\n",
       "      <td>3789.0</td>\n",
       "      <td>1.052500</td>\n",
       "      <td>311</td>\n",
       "      <td>9</td>\n",
       "      <td>0.017278</td>\n",
       "      <td>1.8</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena6.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>True</td>\n",
       "      <td>2491.0</td>\n",
       "      <td>0.691944</td>\n",
       "      <td>438</td>\n",
       "      <td>12</td>\n",
       "      <td>0.024333</td>\n",
       "      <td>2.4</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena8.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>True</td>\n",
       "      <td>4246.0</td>\n",
       "      <td>1.179444</td>\n",
       "      <td>110</td>\n",
       "      <td>10</td>\n",
       "      <td>0.006111</td>\n",
       "      <td>2.0</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T12_31_46_arena4.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>True</td>\n",
       "      <td>2608.0</td>\n",
       "      <td>0.724444</td>\n",
       "      <td>219</td>\n",
       "      <td>4</td>\n",
       "      <td>0.012167</td>\n",
       "      <td>0.8</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena12.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>True</td>\n",
       "      <td>4727.0</td>\n",
       "      <td>1.313056</td>\n",
       "      <td>102</td>\n",
       "      <td>7</td>\n",
       "      <td>0.005667</td>\n",
       "      <td>1.4</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena16.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>True</td>\n",
       "      <td>3404.0</td>\n",
       "      <td>0.945556</td>\n",
       "      <td>59</td>\n",
       "      <td>6</td>\n",
       "      <td>0.003278</td>\n",
       "      <td>1.2</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena3.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>True</td>\n",
       "      <td>2285.0</td>\n",
       "      <td>0.634722</td>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>0.000889</td>\n",
       "      <td>1.0</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena7.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>True</td>\n",
       "      <td>2208.0</td>\n",
       "      <td>0.613333</td>\n",
       "      <td>163</td>\n",
       "      <td>4</td>\n",
       "      <td>0.009056</td>\n",
       "      <td>0.8</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena9.csv</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>89 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    has_aggression  aggression_latency  aggression_latency_mins  nframes  \\\n",
       "0             True              2007.0                 0.557500      609   \n",
       "1             True               902.0                 0.250556      443   \n",
       "2             True              3789.0                 1.052500      311   \n",
       "3             True              2491.0                 0.691944      438   \n",
       "4             True              4246.0                 1.179444      110   \n",
       "..             ...                 ...                      ...      ...   \n",
       "88            True              2608.0                 0.724444      219   \n",
       "89            True              4727.0                 1.313056      102   \n",
       "90            True              3404.0                 0.945556       59   \n",
       "91            True              2285.0                 0.634722       16   \n",
       "92            True              2208.0                 0.613333      163   \n",
       "\n",
       "    nbouts  ratio_frames  ratio_bouts     condition  \\\n",
       "0        6      0.033833          1.2  gal4_control   \n",
       "1        7      0.024611          1.4  gal4_control   \n",
       "2        9      0.017278          1.8  gal4_control   \n",
       "3       12      0.024333          2.4  gal4_control   \n",
       "4       10      0.006111          2.0  gal4_control   \n",
       "..     ...           ...          ...           ...   \n",
       "88       4      0.012167          0.8          test   \n",
       "89       7      0.005667          1.4          test   \n",
       "90       6      0.003278          1.2          test   \n",
       "91       5      0.000889          1.0          test   \n",
       "92       4      0.009056          0.8          test   \n",
       "\n",
       "                               experiment  \n",
       "0    video_2021-02-15T11_52_18_arena3.csv  \n",
       "1    video_2021-02-15T11_52_18_arena4.csv  \n",
       "2    video_2021-02-15T11_52_18_arena6.csv  \n",
       "3    video_2021-02-15T11_52_18_arena8.csv  \n",
       "4    video_2021-02-15T12_31_46_arena4.csv  \n",
       "..                                    ...  \n",
       "88  video_2021-02-19T12_26_51_arena12.csv  \n",
       "89  video_2021-02-19T12_26_51_arena16.csv  \n",
       "90   video_2021-02-19T12_26_51_arena3.csv  \n",
       "91   video_2021-02-19T12_26_51_arena7.csv  \n",
       "92   video_2021-02-19T12_26_51_arena9.csv  \n",
       "\n",
       "[89 rows x 9 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "corrected_ratio_frames = pd.DataFrame()\n",
    "\n",
    "for condition in condition_order:\n",
    "\n",
    "    print('\\n\\t', condition, '\\n')\n",
    "\n",
    "    try:\n",
    "        dataset = aggression_df.query('condition==\"' + condition + '\"')['ratio_frames']\n",
    "\n",
    "        outlier_positions = helpers.check_outliers(dataset)\n",
    "        print(outlier_positions)\n",
    "\n",
    "        fresh_dataset = pd.DataFrame(helpers.remove_outliers(dataset, indices=outlier_positions))\n",
    "        fresh_dataset['condition'] = condition\n",
    "\n",
    "        corrected_ratio_frames = pd.concat([corrected_ratio_frames, fresh_dataset], axis=0)\n",
    "        \n",
    "    except ValueError as error:\n",
    "        print(error)\n",
    "\n",
    "aggression_df = aggression_df.loc[corrected_ratio_frames.index]\n",
    "aggression_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Aggression Rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>condition</th>\n",
       "      <th>ratio_frames</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>0.033833</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>0.024611</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>0.017278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>0.024333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>0.006111</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>test</td>\n",
       "      <td>0.012167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>test</td>\n",
       "      <td>0.005667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>test</td>\n",
       "      <td>0.003278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>test</td>\n",
       "      <td>0.000889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>test</td>\n",
       "      <td>0.009056</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>89 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       condition  ratio_frames\n",
       "0   gal4_control      0.033833\n",
       "1   gal4_control      0.024611\n",
       "2   gal4_control      0.017278\n",
       "3   gal4_control      0.024333\n",
       "4   gal4_control      0.006111\n",
       "..           ...           ...\n",
       "88          test      0.012167\n",
       "89          test      0.005667\n",
       "90          test      0.003278\n",
       "91          test      0.000889\n",
       "92          test      0.009056\n",
       "\n",
       "[89 rows x 2 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ratio_frames_df = aggression_df.copy()[['condition', 'ratio_frames']]\n",
    "ratio_frames_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Statistics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\t gal4_control \n",
      "\n",
      "Shapiro's Test: group 1 IS NOT normally distributed.\n",
      "D'Agostino's Test: group 1 IS normally distributed.\n",
      "Shapiro's Test: group 2 IS NOT normally distributed.\n",
      "D'Agostino's Test: group 2 IS NOT normally distributed.\n",
      "Levene's Test for non-normally distributed samples:\n",
      "  p-value = 0.192355\n",
      "  All groups were sampled from populations with IDENTICAL variances.\n",
      "\n",
      "Mann-Whitney p-value: 0.018803594326723242 \n",
      "\n",
      "\n",
      "\t uas_control \n",
      "\n",
      "Shapiro's Test: group 1 IS NOT normally distributed.\n",
      "D'Agostino's Test: group 1 IS NOT normally distributed.\n",
      "Shapiro's Test: group 2 IS NOT normally distributed.\n",
      "D'Agostino's Test: group 2 IS NOT normally distributed.\n",
      "Levene's Test for non-normally distributed samples:\n",
      "  p-value = 0.385478\n",
      "  All groups were sampled from populations with IDENTICAL variances.\n",
      "\n",
      "Mann-Whitney p-value: 0.007285765338264531 \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'gal4_control': 0.018803594326723242, 'uas_control': 0.007285765338264531}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ratio_frames_pvalues = {}\n",
    "\n",
    "test = ratio_frames_df.query('condition==\"test\"')['ratio_frames']\n",
    "\n",
    "for condition in condition_order[:-1]:\n",
    "        \n",
    "    print('\\n\\t', condition, '\\n')\n",
    "\n",
    "    try:\n",
    "        control = ratio_frames_df.query('condition==\"' + condition + '\"')['ratio_frames']\n",
    "\n",
    "        temp_values = {'control': control, 'test': test}\n",
    "\n",
    "        pvalue_condition = helpers.run_statistics(temp_values)\n",
    "\n",
    "        ratio_frames_pvalues[condition] = pvalue_condition\n",
    "    \n",
    "    except ValueError as error:\n",
    "        print(error)\n",
    "    \n",
    "ratio_frames_pvalues"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Bonferroni Correction\n",
      "---------------------\n",
      "\n",
      "\tOriginal Values:\n",
      " {'gal4_control': 0.018803594326723242, 'uas_control': 0.007285765338264531}\n",
      "\n",
      "\tCorrected Values:\n",
      " {'gal4_control': 0.037607188653446484, 'uas_control': 0.014571530676529061} \n",
      "\n"
     ]
    }
   ],
   "source": [
    "# Bonferroni corretction for multiple comparisons.\n",
    "title = 'Bonferroni Correction'\n",
    "print(title)\n",
    "print('-'*len(title))\n",
    "\n",
    "# Show uncorrected values.\n",
    "print('\\n\\tOriginal Values:\\n', ratio_frames_pvalues)\n",
    "\n",
    "# Apply the bonferroni correction for multiple comparisons.\n",
    "ratio_frames_multi_comp_correction = multipletests(pvals=list(ratio_frames_pvalues.values()), alpha=0.05, method='bonferroni')[1]\n",
    "\n",
    "# Transform the correction results into a dictionary.\n",
    "corrected_ratio_frames_pvalues = dict(zip(list(ratio_frames_pvalues.keys()), ratio_frames_multi_comp_correction))\n",
    "\n",
    "# Show corrected values.\n",
    "print('\\n\\tCorrected Values:\\n', corrected_ratio_frames_pvalues, '\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Effect Size"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gal4_control\n",
      "Small Effect: -0.41472868217054254 \n",
      "\n",
      "uas_control\n",
      "Small Effect: -0.39840637450199196 \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'gal4_control': -0.41472868217054254, 'uas_control': -0.39840637450199196}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ratio_frames_sizes = {}\n",
    "\n",
    "test = ratio_frames_df.query('condition==\"test\"')['ratio_frames']\n",
    "\n",
    "for condition in condition_order[:-1]:\n",
    "\n",
    "    print(condition)\n",
    "    \n",
    "    control = ratio_frames_df.query('condition==\"' + condition + '\"')['ratio_frames']\n",
    "\n",
    "    median_diff = helpers.get_effect_size(control, test, method='median_diff')\n",
    "    \n",
    "    ratio_frames_sizes[condition] = median_diff\n",
    "    \n",
    "ratio_frames_sizes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP4AAAEgCAYAAACU1c66AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nOzdd3xN9//A8dfd2YnsRJYRe8QmSu2ilNKiapYqrdL+UK0OoROtLkVVW5sWX1qK0lq1d8waCRmy985d5/fHbaNpiRtycy/5PB+P+/C4N+fe8z6R9/18zmfKJEmSEAShSpFbOwBBECqfSHxBqIJE4gtCFSQSXxCqIJH4glAFicQXhCqoUhJ/06ZNNGnShLCwMLp06UJUVFRlnFYQhDuQWbofv7CwEE9PTyIjI6lduzaffvopv/32G7/88oslTysIQhksXuIbDAYkSSI7OxuAvLw87OzsLH1aQRDKoLT0CZycnFi8eDHh4eF4eHhgMBg4ePCgpU8rCEIZLF7inzt3jtmzZ3Px4kUSEhJ48803GThwILe7w4iIiEAmk5U8BEGwDIvf43/88cecO3eO5cuXA6aqv1qtJjk5GU9PzzsHJpPd9stB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GA99jhZ3xGUaE2BlfZDo6OiCVSj3KR99yOn78OIKCgtDQ0OBWp7GxEenp6UhOToZcLodGo8H169e9bkcqlfLTXgFgx44dkMvl6Orqglar9TplVUii65dxXQpkJrz29naKi4vzKB8dCrm5ubRixQoqKChwqzNv3jw6c+YMERENDg5SYWEhbdmyxet2Rl8ZLy8vpwULFlBXV9ed2Qk/EFu/sMT3QaDevrodtwrw7u5umjZtGrW3t9O0adP4mW1ERNOnT6cff/yR/7uzs5Pq6uq8bmckwCsqKojjOOru7ubfG7n91N7eTjKZjFQqFWVkZNyhPbw9YusXNtRn3FRVVSErKwtSqRSpqalut44+/fRTqNVqJCQkYP369WhoaIBSqRxzXbt27cLmzZvxxhtveJ3/DgzPga+qqsLJkyfv+L7cSfdav7DEv4lAnqJ6u7xNSSUi/rPsgQMH8PLLLwMAVq5c6XZ/Pj8/Hw6HA6WlpQgJCUF+fj42b9485rZMJhNOnDiBbdu2wWazea3z4IMPev1sfbeJrl/8Mo64x9xLQ/1r167R9OnT3cocDgdFRUVRQ0MDSSQSmjVrFsXFxVFsbCxJJBKqq6uj1tZW0uv1bstZrVaKiIggIqLk5GT+RTQ8pLVarUREVFxcTCqVigYGBojIfUjrbXgtBLH1Czvji8yUKVOQkJCAw4cP82WVlZXIyMiAwWDA+vXrYbPZ0NHRAbvdjtWrV2PPnj2Ijo5GRUUFfvrpJ3658+fPIyUlBQD476ybzWb+/ZGvx5aUlOCff/6BXq+/S3s5fqLrF78eVpiAZLVaKT09nRYuXEjz5s2jl156ibq6uuj++++nxsZGt7oWi4UmT55MV69epZ9//pmefPJJmjNnDslkMlKr1WSz2bxu4//z3ZubmykyMpJqa2sD8oxPJK5+YRN4GEaE2FCfYUSIJT7DiBBLfIYRIZb4DCNCLPEZRoRY4jOMCLHEZxgRYonPMCLEEp9hRIglPsOI0L9oEJy+6KiaGAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 270x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize figure.\n",
    "n_conditions = ratio_frames_df['condition'].nunique()\n",
    "figure, axis = plt.subplots(figsize=(1.25*n_conditions, 4))\n",
    "\n",
    "# Draw the boxplot.\n",
    "sns.boxplot(x='condition',\n",
    "            y='ratio_frames',\n",
    "            data=ratio_frames_df,\n",
    "            order=condition_order,\n",
    "            width=0.6,\n",
    "            showfliers=False,\n",
    "            palette=['#a3b18a', '#a3b18a', '#004b23'],\n",
    "            boxprops={'edgecolor': INK},\n",
    "            medianprops={'color': INK},\n",
    "            whiskerprops={'color': INK},\n",
    "            capprops={'color': INK},\n",
    "           )\n",
    "\n",
    "# Draw the swarmplot.\n",
    "sns.swarmplot(x='condition',\n",
    "              y='ratio_frames',\n",
    "              data=ratio_frames_df,\n",
    "              order=condition_order,\n",
    "              palette=['#a3b18a', '#a3b18a', '#004b23'],\n",
    "              linewidth=0.75,\n",
    "              edgecolor=INK\n",
    "             )\n",
    "\n",
    "# Figure and axes formatting.\n",
    "axis.set_xlabel('')\n",
    "axis.set_xticklabels([''])\n",
    "axis.set_ylabel('Aggression Rate (%)')\n",
    "axis.set_ylim(0, 0.08)\n",
    "axis.set_yticks(np.arange(0, 0.08+0.001, 0.01))\n",
    "axis.set_yticklabels([int(y*100) for y in axis.get_yticks()])\n",
    "\n",
    "# Table definition.\n",
    "row1 = [str(ratio_frames_df.query('condition==\"'+condition+'\"').shape[0]) for condition in condition_order]\n",
    "row2 = ['OR47b-GAL4;\\n+', '+;\\nUAS-Kir', 'OR47b-GAL4;\\nUAS-Kir']\n",
    "cell_text = np.array([row1, row2])\n",
    "\n",
    "row_labels = ['n =', '']\n",
    "summary_table = axis.table(cellText= cell_text,\n",
    "                           cellLoc='center',\n",
    "                           rowLabels=row_labels,\n",
    "                           rowLoc='center',\n",
    "                           colLoc='center',\n",
    "                          )\n",
    "\n",
    "summary_table.auto_set_font_size(False)\n",
    "summary_table.set_fontsize(11)\n",
    "\n",
    "properties = summary_table.properties()\n",
    "table_cells = properties['children']\n",
    "for cell in table_cells:\n",
    "    cell.set_height(0.12)\n",
    "    cell.set_alpha(0)\n",
    "\n",
    "# Draw statistical results.\n",
    "for p, condition in enumerate(condition_order[:-1]):\n",
    "    sig_height = 6 if (corrected_ratio_frames_pvalues.get(condition, 'NaN') == 'NaN') or (corrected_ratio_frames_pvalues.get(condition, 'NaN') >= 0.05) else 2\n",
    "    helpers.plot_stattest_result(ax=axis,\n",
    "                                 x1=1-p,\n",
    "                                 x2=1-p,\n",
    "                                 p_value=corrected_ratio_frames_pvalues.get(condition, 'NaN'),\n",
    "                                 y=0.075,\n",
    "                                 ticksize=0,\n",
    "                                 xytext=(0,sig_height),\n",
    "                                 fontsize=13,\n",
    "                                 color=INK,\n",
    "                                 connector_color=INK\n",
    "                                )\n",
    "\n",
    "# Saving parameters.\n",
    "filename = 'aggression_rate_5mins_Or47b'\n",
    "plt.savefig(os.path.join(savepath, filename))\n",
    "\n",
    "plt.show()\n",
    "plt.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
